<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>test</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <style type="text/css">
       h1 {font-size:16px;}
       p {font-size:14px;text-indent: 20px;}
    </style>
  </head>
  <body>
    <h1>1:接口名称</h1>
    <p>设备初始化</p>
    <h1>2:接口说明</h1>
    <p>/common/init.do</p>
    <h1>3：请求参数</h1>
    <table width="100%" border="1" cellpadding="0" cellspacing="0">
       <tr>
         <td width="20%">参数名</td>
         <td width="20%">必须</td>
         <td width="60%">备注</td>
       </tr>
       <tr>
         <td>mac</td>
         <td>是</td>
         <td>mac地址</td>
       </tr>
       <tr>
         <td>imei</td>
         <td>是</td>
         <td>imei</td>
       </tr>
    </table>
    <h1>4：接口返回</h1>
    <p>
       {code:200}
    </p>
    <h1>5：接口测试</h1>
    <p>
        imei:<input id="imei" value="013141008888585" /><br/>
        mac :<input id="mac" value="12:34:12:e3"  />
     <form name="form1" id="form1" enctype="multipart/form-data" method="post" action="/client/client.do" >
		    <input type="hidden" value="/common/init.do" name="redirect" />
		    <table style="display: none;">
		        <tr><td>product_id_list</td><td><input id="param" name="param" value=""></td></tr>
		    </table>
	    <input type="button" value="submit" onclick="beforeSubmit();">
	</form>
    </p>
    <script>
    function $(id){
        return document.getElementById(id);
    }

    function beforeSubmit(){
        var v1 = $("imei").value;
        var v2 = $("mac").value;
        var obj={
            "imei":v1,
            "mac":v2
        }
        var jsonStr=JSON.stringify(obj);
        $("param").value=jsonStr;
        document.form1.submit();
    }
</script>
  </body>
</html>
